home *** CD-ROM | disk | FTP | other *** search
Oberon Text | 1995-10-06 | 2.2 KB | 63 lines | [TEXT/.Ob4] |
- Syntax10.Scn.Fnt
- Syntax12.Scn.Fnt
- MODULE Configuration; (* jt 22.10.93 / js 28.10.93 *)(*<<<< MAH 20.7.94 *)
- * Executing the body of this module sets up the startup viewer configuration.
- * In addition to the standard config, this configuration sets up an 'intelligent'
- * scrolling log viewer.
- * This module might be changed and recompiled to fit your personal needs.
- * If the Configuration.obj file does not exist, a default configuration will be used.
- IMPORT
- Viewers, Oberon, TextFrames, MenuViewers, Display, Texts, Fonts, Directories;
- CONST
- StandardMenu = "System.Close System.Copy System.Grow Edit.Search Edit.Store ";
- LogMenu = "System.Close System.Grow Edit.Locate Edit.Store ";
- pinPos: LONGINT;
- PROCEDURE HandleLog(F: Display.Frame; VAR M: Display.FrameMsg);
- VAR p, org1, old: LONGINT; y: INTEGER; loc : TextFrames.Location;
- BEGIN
- TextFrames.Handle(F, M);
- IF M IS TextFrames.UpdateMsg THEN
- WITH M: TextFrames.UpdateMsg DO
- IF (M.text = Oberon.Log) & (M.id = TextFrames.insert) THEN
- WITH F: TextFrames.Frame DO
- p:=TextFrames.Pos (F, F.X+F.W, F.Y);
- old:=0;
- WHILE (p#old) & (p<M.text.len) DO
- y:=F.Y+F.H;
- TextFrames.LocateLine (F, y, loc);
- org1:=loc.org;
- REPEAT
- DEC (y);
- TextFrames.LocateLine (F, y, loc);
- UNTIL (loc.org#org1) OR (y=F.Y);
- IF y=F.Y THEN RETURN END;
- TextFrames.Show(F, loc.org);
- old:=p; p:=TextFrames.Pos (F, F.X+F.W, F.Y)
- END
- END
- END
- END
- END
- END HandleLog;
- PROCEDURE OpenViewers;
- VAR logV, toolV: Viewers.Viewer; X, Y: INTEGER; logger: Oberon.Task;
- BEGIN
- Oberon.AllocateSystemViewer(0, X, Y);
- logV := MenuViewers.New(
- TextFrames.NewMenu("System.Log", "^Log.Menu.Text"),
- TextFrames.NewText(Oberon.Log, 0),
- TextFrames.menuH,
- X, Y);
- logV.dsc.next.handle := HandleLog;
- Oberon.AllocateSystemViewer(0, X, Y);
- toolV := MenuViewers.New(
- TextFrames.NewMenu("System.Tool", "^System.Menu.Text"),
- TextFrames.NewText(TextFrames.Text("System.Tool"), 0),
- TextFrames.menuH,
- X, Y + 50) ;
- END OpenViewers;
- BEGIN
- Directories.Change (":User");
- OpenViewers
- END Configuration.
-